-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
BUG: DatetimeIndex slicing with boolean Index raises TypeError #22852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hello @sinhrks! Thanks for updating the PR.
Comment last updated on September 27, 2018 at 09:07 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #22852 +/- ##
=======================================
Coverage 92.25% 92.25%
=======================================
Files 161 161
Lines 51207 51207
=======================================
Hits 47239 47239
Misses 3968 3968
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good could just use parametrization to make test cases cleaner
|
||
def test_getitem_bool_index(self): | ||
# GH#22533 | ||
idx1 = pd.date_range('2011-01-01', '2011-01-05', freq='D', name='idx') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than listing these out sequentially can you parametrize the various cases? Would make the code more succinct and readable
2e4d406
to
dbf2971
Compare
pandas/tests/indexes/test_numeric.py
Outdated
@@ -843,6 +843,28 @@ def test_join_outer(self): | |||
tm.assert_numpy_array_equal(lidx, elidx) | |||
tm.assert_numpy_array_equal(ridx, eridx) | |||
|
|||
@pytest.mark.parametrize('ind1', [[True] * 5, pd.Index([True] * 5)]) | |||
@pytest.mark.parametrize('ind2', [[True, False, True, False, False], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you just add these all to TestIndexOps to get overage on all index (and series) for this. Note that there is an open issue to fixture this ;<
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, added some tests to TestIndexOps
.
6ba6dd8
to
cbd9184
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. just want to avoid duplicating some tests if easy & possible. ping on green.
lgtm. ping on green. @WillAyd over to you. |
can you merge master and ping on green. |
thanks @sinhrks |
git diff upstream/master -u -- "*.py" | flake8 --diff